﻿using System.Drawing;

namespace GViz.Types 
{
    public class DataSet 
    {
        public string Label {
            get; set;
        }

        private int[] _Data;

        public int[] Data {
            get {
                return this._Data;
            }
            set {
                this._Data = value;
                this.CalculateMaxValue();
            }
        }

        public Color Color {
            get; set;
        }

        public int Max {
            get; private set;
        }

        private void CalculateMaxValue() {
            this.Max = 0;
            foreach (int value in this.Data) {
                if (value > this.Max) {
                    this.Max = value;
                }
            }
        }

        public DataSet(string label, int[] data) {
            this.Label = label;
            this.Data = data;

            this.CalculateMaxValue();
        }

        public DataSet(string label, int[] data, Color color) {
            this.Label = label;
            this.Data = data;
            this.Color = color;

            this.CalculateMaxValue();
        }
    }
}
